﻿using UnityEngine;

/// <summary>
/// It's attached at the prefab of the obstacles' variables
/// </summary>
public class ObstacleCheckerVariables : BaseBehaviour
{
    protected override void start()
    {
        checkErrorInVariableObstacle();
    }

    private void checkErrorInVariableObstacle()
    {
        VariablesObstacle variablesObstacle = GameObjectManager.findObjectByType<VariablesObstacle>(typeof(VariablesObstacle));

        if (variablesObstacle.GAP > Mathf.Abs(variablesObstacle.FINAL_X))
        {
            Debug.LogError("VariablesObstacle: GAP cannot be greater than END_X.");
        }
    }
}
